import 'package:flutter/material.dart';
import 'package:syria_sports/core/app_export.dart';

class PublicHomeButton extends StatelessWidget {
  final String title;
  final String subtitle;
  final String description;
  final Function? onTapped;
  final String image;
  const PublicHomeButton({
    super.key,
    required this.title,
    required this.subtitle,
    required this.description,
    this.onTapped,
    required this.image,
  });

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: (){
        onTapped?.call();
      },
      child: Padding(
        padding: const EdgeInsets.all(4.0),
        child: Card(
          color: Colors.white24,
          margin:const EdgeInsets.symmetric(vertical: 4,horizontal: 8),
          child: Container(
            clipBehavior: Clip.antiAlias,
            height: 220,
            decoration: BoxDecoration(
              gradient: LinearGradient(
                begin: Alignment.topCenter,
                end: Alignment.bottomCenter,
                colors: [
                  Colors.black.withOpacity(.4),
                  Colors.transparent,
                  Colors.transparent,
                  Colors.black.withOpacity(.4),
                ],
              ),
              borderRadius: BorderRadius.circular(4),
              image: DecorationImage(
                  fit:BoxFit.cover,
                  isAntiAlias: true,
                  image:Image.asset(image).image
              ),
            ),
            child: Container(
              padding:const EdgeInsets.all(4),
              decoration: BoxDecoration(
                gradient: LinearGradient(
                  begin: Alignment.topCenter,
                  end: Alignment.bottomCenter,
                  colors: [
                    Colors.black.withOpacity(.9),
                    Colors.transparent,
                    Colors.transparent,
                    Colors.black.withOpacity(.9),
                  ],
                ),
                borderRadius: BorderRadius.circular(4),
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      Expanded(
                        child: Column(
                          mainAxisAlignment: MainAxisAlignment.start,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text(title, style: theme.textTheme.titleMedium!.copyWith(color: Colors.white),),
                            SizedBox(
                              child: Text(
                                '',//subtitle,
                                maxLines: 5,
                                style: theme.textTheme.titleMedium?.copyWith(fontSize: 14,color:Colors.white),),
                            ),
                          ],
                        ),
                      ),

                    ],
                  ),
                  Align(
                    alignment: Alignment.centerRight,
                    child: Text(description, style: theme.textTheme.titleSmall?.copyWith(color:Colors.white),),
                  ),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }
}
